<template>
	<div class="workflow-tool-help">
		<el-dialog v-model="isShow">
			<template #title>
				<div v-drag="['.workflow-tool-help .el-dialog', '.workflow-tool-help .el-dialog__header']">数据详情</div>
			</template>
			<json-viewer :value="jsplumbData" :expand-depth="4" copyable boxed sort></json-viewer>
		</el-dialog>
	</div>
</template>

<script lang="ts">
import { defineComponent, reactive, toRefs } from 'vue';
export default defineComponent({
	name: 'pagesWorkflowToolText',
	setup() {
		const state = reactive({
			isShow: false,
			jsplumbData: {}
		});
		// 打开弹窗
		const open = (data: object) => {
			state.isShow = true;
			state.jsplumbData = Object.assign({}, data);
		};
		// 关闭弹窗
		const close = () => {
			state.isShow = false;
		};
		return {
			open,
			close,
			...toRefs(state),
		};
	},
});
</script>
